<?php
declare(strict_types=1);
namespace cms\wechat\admin\mvc_controller;

use cms\wechat\service\OfficialService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;
use Psr\Http\Message\ResponseInterface;

/**
 * Class UserController
 * @package cms\wechat\admin\mvc_controller
 * @AutoController(prefix="mvc/wechat/admin_user")
 */
class UserController extends CommonController
{
    /**
     * @Inject()
     * @var OfficialService
     */
    protected OfficialService $officialService;
    /**
     * @return ResponseInterface
     */
    public function retrieve(): ResponseInterface
    {
        $official_id = (int) $this->request->input('official_id', 0);
        $official = $this->officialService->getDataById($official_id, true);
        return $this->template([
            'official' => $official,
        ]);
    }
}